
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>EJ在线APP 下载</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="EJ在线下载">
  <meta name="description" content="EJ在线下载">
  <style>
    html,body,* { margin: 0;padding: 0;border: none; font-family: -apple-system,"Helvetica Neue","Arial","PingFang SC","Hiragino Sans GB","STHeiti","Microsoft YaHei","Microsoft JhengHei","Source Han Sans SC",sans-serif; }
    body { 
      background-color: #15143a;
      max-width: 640px;
      margin: auto;
    }
    .page {
      position: fixed;
	  z-index: 10;
	  display: flex;
	  width: 100%;
	  height: 100%;
	  background: url(/images/download.png) left top;
	  background-size: 100% 100%;
	  flex-flow: column;
    }
    
    .download-button {
      display: block;
      width: 140px;
      height: 25px;
      text-align: right;
      text-decoration: none;
      font-size: 16px;
      font-weight: normal;
      line-height: 25px;
      border: 0;
      border-radius: 4px;
      padding: 10px 25px 10px 15px;
      margin: 0 auto 20px;
      color: #fff;
      background-repeat: no-repeat;
      background-size: 20px;
      background-position: 20px center;
    }
    .download-button.big {
      width: 180px;
      height: 34px;
      -webkit-background-size: 40px;
      background-size: 30px;
      font-size: 20px;
      line-height: 34px;
    }

    .iphone {
      background-color: RGB(0, 104, 247);
      background-image: url('/images/ios.png');
    }
    .android {
      background-color: RGB(248, 143, 46);
      background-image: url('/images/android.png');
    }
    .tips {
      display: none;
    }
    .tips .mask {
      position: fixed;
      z-index: 1000;
      top: 0;
      right: 0;
      left: 0;
      bottom: 0;
      background-color: rgba(0,0,0,.6);

    }
    .tips .text {
      position: fixed;
      top: 1rem;
      right: 1.8rem;
      width: 11.8rem;
      height: 4.1rem;
      background-size: 100%;
      background-repeat: no-repeat;
      background-image: url('/images/tips.png');
      z-index: 1001;
    }

	.text{
		box-sizing: border-box;
		width: 100%;
		height: 100%;
		display: flex;
		flex-flow: column;
		justify-content: center;
		align-items: center;
	}
	.text h1,.text p{
		box-sizing: border-box;
		width: 80%;
		background-color: #2f5596;
		margin: 0 auto;
		padding: 0.5rem 0;
	}
	.text h1 img{
		display: block;
		width: 80%;
		margin: 0 auto;
	}
	.text p{
		font-size: 1.2rem;
		line-height: 2rem;
		padding:0.8rem 0.5rem;
		color: #fff;
		margin: 0 auto;
		text-align: center;
		background-color: rgba(255,255,255,0.2);
	}
	.text p span{
		color: #ffd225;
	}
  </style>
</head>
<body>
  <div class="page">
	<div class="text">
		<h1><img src="/images/ej.png"></h1>
		<p>一款专注于<span>高端财税实务分享</span>，众多全国著名财税专家入驻，<span>在线直播授课！</span></p>
		<img src="/images/zhi.png" style="display: block;margin: 0 auto; margin: 2rem 0; width: 4rem;">
		<div class="download-buttons">
			<a href="<%=iosUrl%>" class="download-button top big iphone">iPhone &nbsp;版下载</a>
			<a href="<%=androidUrl%>" class="download-button top big android">Android 版下载</a>
			<!-- <a href="javascript:;" class="download-button top big iphone">iPhone &nbsp;版下载</a>
			<a href="javascript:;" class="download-button top big android">Android 版下载</a> -->
		</div>
	</div>
  </div>

  <div class="tips" id="tips">
    <span class="mask"></span>
    <span class="text"></span>
  </div>

</body>

<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript">
  var ua = navigator.userAgent.toLowerCase()
    ,Android = /(android|adr)/.test(ua)
    ,iOS = /ip(hone|od|ad)/i.test(ua)
    ,iPhone = /iphone/i.test(ua)
    ,WindowsPhone = /(windows phone)/.test(ua)
    ,Wechat = /micromessenger/.test(ua)
    ,QQ = /mqqbrowser/.test(ua)

  if (Wechat && Android) { //如果是android微信
    $('#tips').css({
      display: 'block'
    })
  }

  var t = null;

  var config = {
      /*scheme:必须*/
      scheme_Adr: 'app://cqwallet',
      download_url: 'https://cqwallet-core.cqmfin.com/channel/manager/download/CMF101',
      timeout: 1200
  };
  // $('.download-button.android').click(function(){

  //   var startTime = Date.now();
  //   //window.location.href = config.scheme_Adr;
  //   var ifr = document.createElement('iframe');
  //   ifr.src = config.scheme_Adr;
  //   ifr.style.display = 'none';
  //   document.body.appendChild(ifr);

  //   t = setTimeout(function() {

  //       var endTime = Date.now();
  //       //alert(endTime - startTime)
  //       if (!startTime || endTime - startTime < config.timeout + 200) { 
  //           //document.body.removeChild(ifr);
  //           window.location.href = config.download_url;
  //       }
  //   }, config.timeout);

  // });

  $(window).on('visibilitychange', function() {
      //alert(Date.now());
      clearTimeout(t);
  });

  $(window).on('blur', function() {
      //alert(Date.now());
      clearTimeout(t);
  });

  // $('.iphone').click(function () {
  //   if (Wechat || QQ) {
  //     window.open("http://sj.qq.com/myapp/detail.htm?apkName=com.cmf.cqwallet")
  //   } else {
  //     window.location.href = 'https://itunes.apple.com/cn/app/%E9%87%8D%E5%BA%86%E9%92%B1%E5%8C%85app/id1250280925?l=en&mt=8'
  //   }
  // })
</script>
</html>